using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;


namespace xna_game_engine.source
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class LevelManager
    {
        // Members
        private Dictionary<int, Level> mLevels;
        private int mCurrentActiveLevel;

        // Functions
        public LevelManager()
        {
            mCurrentActiveLevel = 1;
            mLevels = new Dictionary<int,Level>();
        }

        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public void Initialize()
        {
            Level temp = new Level();
            mLevels[1] = temp;
        }

        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public void Update(GameTime gameTime)
        {
        }

        public void Draw()
        {
            foreach (KeyValuePair<int, Level> kvp in mLevels)
            {
                kvp.Value.Draw();
            }
        }

        public void LoadContent()
        {
            foreach (KeyValuePair<int, Level> kvp in mLevels)
            {
                kvp.Value.LoadContent();
            }
        }

        // Properties
        public Vector2 PlayerStart
        {
            get { return mLevels[mCurrentActiveLevel].PlayerStart; }
        }
        public List<Vector2> EnemyStarts
        {
            get { return mLevels[mCurrentActiveLevel].EnemyStarts; }
        }
        public int VerticalTop
        {
            get { return mLevels[mCurrentActiveLevel].VerticalTop; }
        }
        public int VerticalBottom
        {
            get { return mLevels[mCurrentActiveLevel].VerticalBottom; }
        }
    }
}